<template lang="jade">
	div.return-bar
		i.iconfont(@click="back()") &#xe668;
		我的积分
	div.shoping-page.detail_top
		header
			flexbox
				flexbox-item(:span='3')
					div.protrait(style="background:url(http://www.uximoney.com/themes/blue/img/protrait.png);background-size:cover;border-radius:50%")

				flexbox-item.info
					div.date
					span 您好, {{item.realname}}
						img(src="../../assets/images/golden-metal.png")
					em 我的积分
					strong {{item.integral}}

		ul.s-menu.bottom
			li(v-link="{ path: '/point-record'}")
				i.iconfont.ft &#xe63c;
				积分记录
				i.iconfont.se &#xe600;
</template>

<script>
import '../../assets/sass/shopping.scss'
import {c_userIntegral} from '../../config/api'
import {Loading, Flexbox, FlexboxItem} from 'vux'


export default{
	data(){
		return{
			item:{}
		}
	},
	components: {
		Flexbox,
		FlexboxItem,
		Loading
	},
	methods: {
	    back(){
	      window.history.back();
	    },

		fetch: function () {

			this.$http({url: c_userIntegral, method: 'GET'}).then(function (response) {
				var obj = response.data;
				if(obj.status){
					this.item = obj
					this.busy = false;
				}
				else{
					return;
				}
			});
		}

	},
	route:{
		activate( transition ){
			transition.next();
			this.fetch();
		}
	}
}

</script>
